#!/usr/bin/python
# -*- coding:UTF-8 -*-

from schema import XiaoneiParam

SIGNATURE=XiaoneiParam()
USER=XiaoneiParam("user")
SESSION_KEY=XiaoneiParam("session_key")
EXPIRES=XiaoneiParam("expires")
IN_CANVAS=XiaoneiParam("in_canvas")
IN_IFRAME=XiaoneiParam("in_iframe")
IN_PROFILE=XiaoneiParam("profile")
TIME=XiaoneiParam("time")
FRIENDS=XiaoneiParam("friends")
ADDED=XiaoneiParam("added")
PROFILE_UPDATE_TIME=XiaoneiParam("profile_update_time")
API_KEY=XiaoneiParam("api_key")
SMS=XiaoneiParam("sms")
MESSAGE=XiaoneiParam("message")
SMS_SID=XiaoneiParam("sms_sid")
SMS_NEW_USER=XiaoneiParam("sms_new_user")
POSITION_FIX=XiaoneiParam("position_fix")

_lookupTable={}

for x in locals().keys():
    if isinstance(locals()[x],XiaoneiParam):
        _lookupTable[str(locals()[x])]=locals()[x]
        
def stripSignaturePrefix(paramName):
    if paramName and paramName[0:7]=="xn_sig_":
        return paramName[7:]
    else:
        return paramName


if __name__=="__main__":
    print stripSignaturePrefix("xn_sig___paramName")
    print _lookupTable